package com.wx.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wx.pojo.AdvertisementVO;
import com.wx.pojo.vo.JsonResult;
import com.wx.service.AdertisementService;

@RestController
@RequestMapping("/adver/")
public class AdvertisementController {

	@Autowired
	AdertisementService adertisementService;
	
	@RequestMapping("findAdvertisement")
	public AdvertisementVO findAdvertisement(Integer id,String userId) {
		return adertisementService.findAdvertisementById(id);
	}
	
	@RequestMapping("addAdver")
	public JsonResult addAdver(String token,String title,String commIds) {
		JsonResult jsonResult = new JsonResult();
		jsonResult.setData(adertisementService.addAdver(token,title,commIds));
		return jsonResult;
	}
	
}
